<include file="public:header" />

<br />
<br />
<br />
<div class="container">
    
    <h2>添加巡检图片</h2>
    <form id="formBox" role="form" action="index.php?g=api&m=inspection&a=addImages" method="post">
        <div class="form-group">
          <select name="storeId" class="form-control">
            <volist name="stores" id="store">
            <option value="{$store.id}">{$store.name}</option>
            </volist>
          </select>
        </div>
        <div class="form-group">
    <label for="images1">图片1</label>
    <input type="file" name="images[]" id="images1">
  </div>
  <div class="form-group">
    <label for="images2">图片2</label>
    <input type="file" name="images[]" id="images2">
  </div>

        <button type="submit" class="btn btn-default">Submit</button>
     </form>
</div>

<br />
<div class="container">
    <h2>添加拜访图片</h2>
    <form id="formBox2" role="form" action="index.php?g=api&m=visit&a=addImages" method="post">
        <div class="form-group">
          <select name="storeId" class="form-control">
            <volist name="stores" id="store">
            <option value="{$store.id}">{$store.name}</option>
            </volist>
          </select>
        </div>
        <div class="form-group">
          <select name="type" class="form-control">
            <option value="client">拜访客户</option>
            <option value="market">市场走访</option>
            <option value="meeting">会议</option>
          </select>
        </div>
        <div class="form-group">
    <label for="images1">图片1</label>
    <input type="file" name="images[]" id="images1">
  </div>
  <div class="form-group">
    <label for="images2">图片2</label>
    <input type="file" name="images[]" id="images2">
  </div>

        <button type="submit" class="btn btn-default">Submit</button>
     </form>
</div>


<script type="text/javascript">
$(document).ready(function(){
    //绑定一个指定的表单
    $('#formBox').ajaxForm({ 
            //设置传输的数据类型
            dataType:  'json', 
            //请求成功后，调用的回调函数
            success:  back
    }); 

//绑定一个指定的表单
    $('#formBox2').ajaxForm({ 
            //设置传输的数据类型
            dataType:  'json', 
            //请求成功后，调用的回调函数
            success:  back
    }); 
    function back(data){
        if(data.status === 200){
            alert(data.msg);
            console.log(data.data);
        }else{
           alert(data.msg);
        }
    }
});


</script>

<include file="public:footer" />